{
 "cells": [
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": [
    "# 分类问题\n",
    "\n",
    "## 逻辑回归\n",
    "\n",
    "### 二进制分类\n",
    "#### sigmoid 函数\n",
    "g 代表一个常用的逻辑函数（logistic function）为S形函数（Sigmoid function），公式为： \\\\[g\\left( z \\right)=\\frac{1}{1+{{e}^{-z}}}\\\\] \n",
    "线性函数(以直线方程为例，也可以是多项式)\n",
    "$$ z =  \\vec k \\cdot \\vec x + b$$\n",
    "\n",
    "合起来，我们得到逻辑回归模型的假设函数： \n",
    "\t\\\\[{{h}_{\\theta }}\\left( x \\right)=\\frac{1}{1+{{e}^{-{{(\\vec k \\cdot \\vec x + b) }}}}}\\\\] \n",
    "\n",
    "<img src=\"images/Sigmoid.png\" style=\"width:500px;height:228px;\">\n",
    "\n",
    "### 决策边界\n",
    "判断结果是否为真一般要设置阈值，一般以0.5为界，大于0.5为真，结合上述公式\n",
    "可判断出，当 z > 0 为真，否则为假，边界方程为\n",
    "$$ \\vec k \\cdot \\vec x + b = 0 $$"
   ],
   "id": "a6540f176fa73844"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "d0d6bec086b308f1"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
